c3688c24f60a8754519649ee31ffb80ccf597d6c,jsonschema2pojo-integration-tests/src/test/java/org/jsonschema2pojo/integration/config/GsonIT.java,GsonIT,annotationStyleGsonProducesGsonAnnotations,#,43

Before Change


    @SuppressWarnings({ "rawtypes", "unchecked" })
    public void annotationStyleGsonProducesGsonAnnotations() throws ClassNotFoundException, SecurityException, NoSuchMethodException, NoSuchFieldException {

        File generatedOutputDirectory = generate("/json/examples/torrent.json", "com.example",
                config("annotationStyle", "gson",
                        "propertyWordDelimiters", "_",
                        "sourceType", "json"));

        assertThat(generatedOutputDirectory, not(containsText("org.codehaus.jackson")));
        assertThat(generatedOutputDirectory, not(containsText("com.fasterxml.jackson")));
        assertThat(generatedOutputDirectory, containsText("com.google.gson"));
        assertThat(generatedOutputDirectory, containsText("@SerializedName"));

        ClassLoader resultsClassLoader = compile(generatedOutputDirectory);

        Class generatedType = resultsClassLoader.loadClass("com.example.Torrent");
        Method getter = generatedType.getMethod("getBuild");

        assertThat(generatedType.getAnnotation(JsonPropertyOrder.class), is(nullValue()));

After Change


    @SuppressWarnings({ "rawtypes", "unchecked" })
    public void annotationStyleGsonProducesGsonAnnotations() throws ClassNotFoundException, SecurityException, NoSuchMethodException, NoSuchFieldException {

        Class generatedType = schemaRule.generateAndCompile("/json/examples/torrent.json", "com.example",
                config("annotationStyle", "gson",
                        "propertyWordDelimiters", "_",
                        "sourceType", "json"))
                .loadClass("com.example.Torrent");

        assertThat(schemaRule.getGenerateDir(), not(containsText("org.codehaus.jackson")));
        assertThat(schemaRule.getGenerateDir(), not(containsText("com.fasterxml.jackson")));